<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>使数组中所有元素都等于0</title>
</head>

<body>
  <script>
    var minimumOperations = function (nums) {
      return new Set(nums.filter(Boolean)).size;
    };
    console.log(minimumOperations([1, 5, 0, 3, 5]))
  </script>
</body>

</html>